extends Ammo

const BASE_LASER_SPEED = 200.0
const VELOCITY = Vector2(0, -1)

func _ready() -> void:
	add_to_group("enemies")

func _physics_process(delta: float) -> void:
	move(BASE_LASER_SPEED, delta)

func move(laser_speed: float, delta: float) -> void:
	#position.y -= laser_speed * delta
	global_position += VELOCITY.rotated(rotation) * laser_speed * delta

#当子弹出了屏幕就销毁
func _on_visible_on_screen_notifier_2d_screen_exited() -> void:
	queue_free()

func _on_hitbox_hit(_hurtbox: Hurtbox) -> void:
	queue_free()
